<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>DNS管理</title>

<style type = "text/css">
    .Validform_right{color:green}
    .Validform_wrong{color:red}
</style>

    <!-- Bootstrap -->
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="/static/css/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <link href="/static/css/nprogress.css" rel="stylesheet">
    <!-- Animate.css -->
    <link href="/static/css/animate.min.css" rel="stylesheet">
     <link href="/static/css/sweetalert.css" rel="stylesheet">
    <!-- Custom Theme Style -->
    <link href="/static/css/custom.min.css" rel="stylesheet">
  </head>

  <body class="login">
    <div>
      <a class="hiddenanchor" id="signup"></a>
      <a class="hiddenanchor" id="signin"></a>

      <div class="login_wrapper">
        <div class="animate form login_form">
          <section class="login_content">

              <form  class="login"  action="#" id="loginform" >
                    {% csrf_token %}
              <h1>内部DNS域名系统</h1>
              <div>
                    <input type="text" id="username" class="form-control" name="username"  placeholder="用户名" datatype="s5-16" errormsg="昵称至符,最多16个字符！"/>
              </div>
              <div>
                    <input type="password" id="password" class="form-control" name="password" placeholder="密码" datatype="s1-16" errormsg="密码至符,最多16个字符!"/>
              </div>
              <div>
                   <button type="submit" id="loginbtn" class="btn btn-primary btn-block btn-flat">Sign In</button>
              </div>

              <div class="clearfix"></div>

              <div class="separator">
                 
                  <p>管理员 weixin: 123456</p>
                </div>

            </form>
          </section>
        </div>
		
      </div>
    </div>
    <!-- jQuery 3 -->
    <script src="/static/js/jquery.min.js"></script>
    <!-- Bootstrap 3.3.7 -->
    <script src="/static/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="/static/js/sweetalert.min.js"></script>

    <script type="text/javascript" src="/static/js/Validform_v5.3.2_min.js"></script>

    <script>
        $(function(){
   $(".login").Validform({
           tiptype:3
               });
               })

  $('#loginbtn').on('click',function(){
    var check = $("#loginform").Validform().check()
    if (check) {
  $('#loginform').on('submit',function(){
    var str = $('#loginform').serialize();
    $.post('#',str,function(data){
        console.log(data)
        if (data.code == 0){
            location.href=data.next_url
        }else{
            swal({
                title: data.msg,
                type: "error",
                confirmButtonText: "确定"
            },function(){
                $("#username").val("");
                $("#password").val("")
            });

        }
    });
    return false;

    })
   }
})



    </script>
  </body>
</html>
